package com.scujj.cs6.model.dto.user;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;

/**
 * 用户注册 DTO
 */
@Data
@Schema(name = "用户注册信息" , description = "用户注册信息")
public class UserRegisterDTO {
    @Schema(description = "用户名", example = "JohnDoe" , requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "用户名不能为空")
    private String username;

    @Schema(description = "邮箱", example = "john.doe@example.com" ,requiredMode = Schema.RequiredMode.REQUIRED)
    @Email(message = "邮箱格式不正确")
    private String email;

    @Schema(description = "手机号", example = "13800138000" , requiredMode = Schema.RequiredMode.REQUIRED)
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式错误")
    @Size(min = 11, max = 11, message = "手机号格式错误")
    private String phone;

    @Schema(description = "密码", example = "P@ssw0rd" , requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "密码不能为空")
    @Size(min = 6, max = 20, message = "密码长度必须在 6-20 位之间")
    private String password;

    @Schema(description = "确认密码", example = "P@ssw0rd" , requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "确认密码不能为空")
    @Size(min = 6, max = 20, message = "密码长度必须在 6-20 位之间")
    private String confirmPassword;
}